<template>
  <div style="width: 100%">
    <div
      class="foldingPanelAdvancedList"
    >
      <slot :panelitem="panelitem"></slot>
    </div>
  </div>
</template>
<script>
export default {
  props:{
    item:{
      type:Object,
      default:()=>{
        return {}
      }
    },
    indexNum:{
      type:Number,
      default:NaN
    },
    type:{
      type:String,
      default:'default'
    }
  },
  data() {
    return {
      panelitem: {},
    };
  },
  methods: {
    clickChange(){
      console.log(1234213123)
      this.$emit('change')
    }
  },
  watch: {
    item: {
      deep: true,
      immediate: true,
      handler(val) {
         if (val) {
          this.panelitem = JSON.parse(JSON.stringify(this.item))
          if (this.item.isOpen) {
            this.panelitem.isOpen = this.item.isOpen
          } else {
            this.panelitem.isOpen = false
          }
          this.panelitem.index = this.indexNum
          this.panelitem.type = this.type
        }
      },
    },
  },
};
</script>